import ServiceBase from '../base';
import {httpResultProxy} from '../proxy';

const BACK_UP = '/backup';

class BackupService extends ServiceBase {
    backupDatabase = () => {
        let promise = super.post({
            url: `${BACK_UP}/database`,
        });
        return httpResultProxy(promise);
    };
    backupFileResource = () => {
        let promise = super.post({
            url: `${BACK_UP}/fileResource`,
        });
        return httpResultProxy(promise);
    };
    getBackupDatabaseStatus = () => {
        let promise = super.get({
            url: `${BACK_UP}/database/status`,
        });
        return httpResultProxy(promise);
    };
    getBackupFileStatus = () => {
        let promise = super.get({
            url: `${BACK_UP}/fileResource/status`,
        });
        return httpResultProxy(promise);
    };
}

export default BackupService;
